import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from "../views/Layout.vue"
import Workbench from "../views/Workbench.vue"

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    children: [
      {
        path: '',
        name: 'Workbench',
        component: Workbench,
        meta: {
          isLogin: true
        }
      },
      {
        path: 'check',
        name: 'Check',
        component: () => import("../views/Check.vue"),
        meta: {
          isLogin: true
        }
      },
      {
        path: 'state',
        name: 'State',
        component: () => import("../views/State.vue"),
        meta: {
          isLogin: true
        },
      },
      {
        path: 'advertisingSign',
        name: 'AdvertisingSign',
        component: () => import("../views/AdvertisingSign.vue"),
        meta: {
          isLogin: true
        },
      },
      {
        path: 'advertisingContent',
        name: 'AdvertisingContent',
        component: () => import("../views/AdvertisingContent.vue"),
        meta: {
          isLogin: true
        },
      },
      {
        path: 'activityContent',
        name: 'ActivityContent',
        component: () => import("../views/ActivityContent.vue"),
        meta: {
          isLogin: true
        },
      },
      {
        path: 'integralWithdrawal',
        name: 'IntegralWithdrawal',
        component: () => import("../views/IntegralWithdrawal.vue"),
        meta: {
          isLogin: true
        },
      },
      {
        path: 'businessManagement',
        name: 'BusinessManagement',
        component: () => import("../views/BusinessManagement.vue"),
        meta: {
          isLogin: true
        },
      },
      {
        path: 'commodityIntegral',
        name: 'CommodityIntegral',
        component: () => import("../views/CommodityIntegral.vue"),
        meta: {
          isLogin: true
        },
      },
      {
        path: 'carFile',
        name: 'CarFile',
        component: () => import("../views/CarFile.vue"),
        meta: {
          isLogin: true
        },
        
      },
     
      {
        path: 'administratorFile',
        name: 'AdministratorFile',
        component: () => import("../views/AdministratorFile.vue"),
        meta: {
          isLogin: true
        },
      },
      {
        path: 'carDetails/:id',
        name: 'CarDetails',
        component: () => import("../views/CarDetails.vue"),
        meta: {
          isLogin: true
        },
      }
    ]
  }, 
  {
    path: '/login',
    name: 'Login',
    component: () => import("../views/Login.vue")
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
